home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
081
/
yamck100.arc
/
YABBS.H
next >
Wrap
C/C++ Source or Header
|
1988-05-11
|
18KB
|
495 lines
/************************************************************************/
/************************************************************************/
/* */
/* RADICALLY PUBLIC DOMAIN */
/* */
/* Header file definitions for Fido/Opus/PBBS. */
/* */
/* Author : William Beebe. */
/* Started: 1 May 1987 */
/* */
/* This header definition file is a blantant copy of Fido and Opus */
/* data and structure definitions. This header file is in fact a sub- */
/* set of both (though it may in time become a superset). */
/* PBBS will try to make itself as compatible with Opus data structures */
/* as possible. This means forgoing strict compatibility with Fido. */
/* */
/* RADICALLY PUBLIC DOMAIN */
/* */
/************************************************************************/
/************************************************************************/
/* System defines and common structures. */
typedef unsigned bit;
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
#include <time.h>
#define d_year time_list->tm_year
#define d_mon (time_list->tm_mon + 1)
#define i_mon time_list->tm_mon
#define d_mday time_list->tm_mday
#define d_yday (time_list->tm_yday + 1)
#define d_wday time_list->tm_wday
#define d_sec time_list->tm_sec
#define d_min time_list->tm_min
#define d_hour time_list->tm_hour
#define yes -1
#define no 0
#define dim(x) (sizeof(x)/sizeof(x[0])) /* macro to return the number */
/* of elements in a structure. */
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
/* Utility structures and defines. */
/* Access levels. */
#define TWIT -2 /* Fido base definition. */
#define DISGRACE 0 /* Fido base definition. */
#define NORMAL 2 /* Fido base definition. */
#define PRIVEL 4 /* Fido base definition. */
#define EXTRA 6 /* Fido base definition. */
#define ASSTSYSOP 8 /* Opus extension. */
#define SYSOP 10 /* Fido base definition. */
#define HIDDEN 11 /* Opus extension. */
/* Help levels. */
#define EXPERT 2 /* no menus. */
#define REGULAR 4 /* brief menus, usually just letters. */
#define NOVICE 6 /* verbose multi-line menus. */
/* System flags. */
#define SYSMAIL 1 /* is a mail area. */
#define SYSOVR 2 /* overwritting files OK. */
#define NOPUBLIC 4 /* OPUS: disallow public messages. */
#define NOPRIVATE 8 /* OPUS: disallow private messages. */
#define ANON_OK 16 /* OPUS: enable anonymous messages. */
#define ECHOMAIL 32 /* OPUS: set is EchoMail, clr is not. */
/* Matrix mask. Undefined bits are reserved by Opus */
#define NO_TRAFFIC 0x0001 /* ok to send outbound local */
#define LOCAL_ONLY 0x0002 /* ok to send outbound local */
#define OPUS_ONLY 0x0004 /* only send to #CM systems */
#define NO_EXITS 0x2000 /* crash/arc exits ignored */
#define MAIL_ONLY 0x4000 /* no human callers allowed */
#define TAKE_REQ 0x8000 /* file requests are ok */
/* Misc. flags. */
#define LOGECHO 0x0001 /* log echomail areas */
#define STEADY 0x0002 /* never change baud rate */
#define ECHOSCAN 0x0004 /* automatically scan echo's */
#define ECHO_GUARD 0x0008 /* no toss un-pwd echo arc */
#define NO_FWD 0x0010 /* No IN TRANSIT netmail */
/* Time stamp structure. */
struct _stamp
{
word date;
word time;
};
/* FOSSIL information structure. */
struct _fossil
{
word strsiz; /* size of the structure in bytes. */
byte majver; /* major revision of FOSSIL driver. */
byte minver; /* minor revision of FOSSIL driver. */
char far *ident; /* FOSSIL identification string. */
word ibufr; /* size of the input buffer. */
word ifree; /* number of bytes left in buffer. */
word obufr; /* size of the output buffer. */
word ofree; /* number of bytes left in buffer. */
byte switdth; /* width of screen on this adapter. */
byte sheigth; /* height of screen " " " */
byte baud; /* ACTUAL baud rate, computer to modem. */
};
/* The USER file. */
/* User file structure. */
#define MAXREAD 10 /* number of message areas to maintain. */
#define _no_ibm 0x0004 /* YABBS: can't handle IBM > 128. */
#define _use_lore 0x0008 /* OPUS: uses line oriented editor. */
#define _more 0x0010 /* wants the "More?" prompt. */
#define _ansi 0x0020 /* OPUS: set wants Ansi. */
#define _kludge 0x0040 /* OPUS: set used Opus before. */
#define _formfeed 0x0080 /* OPUS: set xmit formfeeds. */
struct _usr
{
char name[36]; /* caller's first and last names. */
char city[36]; /* caller's city and state. */
int lastmsg[20]; /* maximum areas now 20. */
char pwd[16]; /* caller's password. */
int times; /* number of previous calls. */
int help; /* caller's help level. */
int tabs; /* 0 = transmit <sp> instead of tabs. */
int nulls; /* number of nulls after <cr> */
int msg; /* last message area visited. */
word flags; /* user flags - see below. */
/* bit filler : 3; OPUS: filler. */
/* bit use_lore : 1; OPUS: uses line oriented editor. */
/* bit more : 1; wants the "More?" prompt. */
/* bit ansi : 1; OPUS: set wants Ansi. */
/* bit kludge : 1; OPUS: set used Opus before. */
/* bit formfeed : 1; OPUS: set xmit formfeeds. */
int priv; /* access level. */
char ldate[20]; /* last date on system. */
int time; /* time on-line so far today. */
int flag; /* used to hold baud rate for outside. */
int upld; /* total k-bytes uploaded. */
int dnld; /* total k-bytes downloaded. */
int dnld1; /* k-bytes downloaded today. */
int files; /* last file area visited. */
byte width; /* character width of caller's monitor. */
byte len; /* line height of caller's monitor. */
int credit; /* network credit. */
int debit; /* network debit. */
};
#define MAXLREAD 10
struct _old_usr
{
char name[36]; /* caller's first and last names. */
char city[36]; /* caller's city and state. */
struct /* Last message read for the prior 10 areas. */
{
word area;
word msg;
} lastmsg[MAXLREAD];
char pwd[16]; /* caller's password. */
int times; /* number of previous calls. */
int help; /* caller's help level. */
int tabs; /* 0 = transmit <sp> instead of tabs. */
int nulls; /* number of nulls after <cr> */
int msg; /* last message area visited. */
word flags; /* user flags - see below. */
/* bit filler : 3; OPUS: filler. */
/* bit use_lore : 1; OPUS: uses line oriented editor. */
/* bit more : 1; wants the "More?" prompt. */
/* bit ansi : 1; OPUS: set wants Ansi. */
/* bit kludge : 1; OPUS: set used Opus before. */
/* bit formfeed : 1; OPUS: set xmit formfeeds. */
int priv; /* access level. */
char ldate[20]; /* last date on system. */
int time; /* time on-line so far today. */
int flag; /* used to hold baud rate for outside. */
int upld; /* total k-bytes uploaded. */
int dnld; /* total k-bytes downloaded. */
int dnld1; /* k-bytes downloaded today. */
int files; /* last file area visited. */
byte width; /* character width of caller's monitor. */
byte len; /* line height of caller's monitor. */
int credit; /* network credit. */
int debit; /* network debit. */
};
/* System file definitions. */
struct _sys
{
dword callers; /* Total # of callers in system.bbs. */
byte msgpriv; /* YABBS: minimum privs for msg area. */
byte filepriv; /* YABBS: minimum privs for file area. */
char msgpath[40]; /* path to messages. */
char bbspath[40]; /* path to bbs or barricade file. */
char hlppath[40]; /* path to help files. */
char uppath[40]; /* path to upload area. */
char filepath[40]; /* path to download area. */
word attrib; /* message area attribute. */
word ms_caller;
long quote_pos; /* position of next usable quote file byte. */
char msg_tag[9]; /* YABBS: message area tag. */
char file_tag[9]; /* YABBS: file area tag. */
word lastread; /* YABBS: last message read by sysop. */
byte filler[22]; /* YABBS: filler out to 256 bytes. */
};
/* System file definitions. */
struct _old_sys
{
word callers; /* Total # of callers in system.bbs. */
word priv; /* minimum privs for this area. */
char msgpath[40]; /* path to messages. */
char bbspath[40]; /* path to bbs or barricade file. */
char hlppath[40]; /* path to help files. */
char uppath[40]; /* path to upload area. */
char filepath[40]; /* path to download area. */
word attrib; /* message area attribute. */
word ms_caller;
long quote_pos; /* position of next usable quote file byte. */
};
/* Messages. */
/* Message attributes. */
/* p = preserved across net*/
/* n = not used by Opus. */
/* s = preserved by Seadog */
#define MSGPRIVATE 0X0001 /* private message. p */
#define MSGCRASH 0X0002 /* accept for forwarding. p */
#define MSGREAD 0X0004 /* read by addressee. p */
#define MSGSENT 0X0008 /* sent ok (remote). */
#define MSGFILE 0X0010 /* file attached to message. p */
#define MSGFWD 0X0020 /* being forwarded. */
#define MSGORPHAN 0X0040 /* unknown dest node. */
#define MSGKILL 0X0080 /* kill after mailing. p */
#define MSGLOCAL 0X0100 /* FidoNet vs. local. */
#define MSGHOLD 0X0200 /* Hold, don't send. p */
#define MSGXX2 0X0400 /* STRIPPED by FidoNet. ns */
#define MSGFRQ 0X0800 /* file request. p */
#define MSGRRQ 0X1000 /* receipt requested. pn */
#define MSGCPT 0X2000 /* is a return receipt. pn */
#define MSGARQ 0X4000 /* audit trail requested. pn */
#define MSGURQ 0X8000 /* update request. pn */
/* Message header. */
struct _msg
{
char from[36]; /* who the message is from. */
char to[36]; /* who the message is to. */
char subject[72]; /* the message's subject. */
char date[20]; /* date message entered. */
word times; /* Fido: number of times read. */
word dest; /* destination node. */
word orig; /* originating node number. */
word cost; /* unit cost charged to send message. */
word orig_net; /* originating network number. */
word dest_net; /* destination network number. */
struct _stamp date_written; /* Date message was written. */
struct _stamp date_arrived; /* Date message arrived on-line.*/
word reply; /* Current msg is a reply to this msg. */
word attr; /* attribute (behavior) of the message. */
word up; /* next message in the thread. */
};
/* Events. */
#define EXT_EVENT 'X' /* External event (return to Dos) */
#define YELL_EVENT 'Y' /* Yell event (when Yell is on) */
#define SCHEDS 35 /* Maximum number of events. */
struct _ftime
{
word year; /* Used */
word month; /* Used */
word day; /* Used */
word daywk; /* Fido: day of the week */
word hour; /* 0..23 */
word mins; /* 0..59 */
word sec; /* Unused */
};
/* Schedule file record */
struct _sched
{
struct _ftime _etime; /* Starting time of the event. */
word len; /* Duration of event in minutes. */
int enable; /* 1==Enabled. Opus: -1 == deleted. */
word trigger; /* Unknown/unused. */
word result; /* X errorlevel; OPUS: Yell bell duration.*/
byte tag; /* Event type ('A'..'Z'). */
byte junk_1; /* OPUS: Added to make this word-aligned.*/
word last_ran; /* OPUS: day of the month last ran. */
word b,c; /* OPUS: Reserved. */
word behavior; /* OPUS: see below. */
byte event_mask; /* OPUS: force this event. */
byte GMT; /* OPUS: Set=GMT, Clear=local time. */
};
#define FORCE_EVENT 0x0001 /* Execute this always. */
/*
Z EVENTS BEHAVIOR...
If RESULT==1, the `behavior' field contains a "matrix mask".
If RESULT==2, it is an internal housekeeping event.
HOUSEKEEPING
*/
#define CLEAN_HOLD 0x0001 /* del HoldArea "$" files */
#define SCAN_ALL 0x0002 /* scan all echomail areas */
/* Mailer structures. */
/* MAIL.SYS file structure */
struct _mail
{
int node; /* Our node number */
float fudge; /* Unknown/unused */
int rate; /* Maximum baud rate */
char mailpath[80]; /* Path for incomming messages */
char filepath[80]; /* Path for incomming files */
int net; /* Our network number */
int alt_node; /* Alternate node number */
int alt_net; /* Alternate net number */
};
/*
NODELIST.SYS file record structure.
NET > 0 and NODE > 0 Normal node
NET > 0 and NODE <= 0 Host node
Net host........node== 0
Regional host...node==-1
Country host....node==-2
NET == -1 Nodelist.Sys revision
NET == -2 Nodelist statement
*/
struct _node
{
int number; /* node number */
int net; /* net number */
int cost; /* cost of a message to this node */
int rate; /* baud rate */
char name[20]; /* node name */
char phone[40]; /* phone number */
char city[40]; /* city and state */
};
/************************************************************************/
/* */
/* New Nodelist structure */
/* */
/* This new nodelist structure was taken from Bob Hartman's Parselst */
/* source header file TYPES.H. It is included here in order to make */
/* YABBS software compatible with the Version 6 nodelist used by */
/* Opus 1.1 and BinkleyTerm. */
/************************************************************************/
struct _node6
{
int net; /* net number. */
int number; /* node number. */
int cost; /* cost per minute to call. */
char name[34]; /* node name. */
char phone[40]; /* phone number. */
char city[30]; /* city and state. */
char password[8]; /* warning, not necessarily null terminated */
int realcost; /* phone company's charge. */
int hubnode; /* this node's hub number or 0 if none. */
char rate; /* actual baud rate divided by 300. */
char modem; /* modem type code (see below). */
word flags1; /* set of flags (see below). */
int reserved; /* reserved. */
};
/*------------------------------------------------------------------------*/
/* Values for the `flags1' field */
/*------------------------------------------------------------------------*/
#define B_hub 0x0001 /* node is a net hub 0000 0000 0000 0001 */
#define B_host 0x0002 /* node is a net host 0000 0000 0000 0010 */
#define B_region 0x0004 /* node is region coord 0000 0000 0000 0100 */
#define B_zone 0x0008 /* node is a zone coord 0000 0000 0000 1000 */
#define B_CM 0x0010 /* runs continuous mail 0000 0000 0001 0000 */
#define B_ores1 0x0020 /* reserved for Opus 0000 0000 0010 0000 */
#define B_ores2 0x0040 /* reserved for Opus 0000 0000 0100 0000 */
#define B_ores3 0x0080 /* reserved for Opus 0000 0000 1000 0000 */
#define B_ores4 0x0100 /* reserved for Opus 0000 0001 0000 0000 */
#define B_ores5 0x0200 /* reserved for Opus 0000 0010 0000 0000 */
#define B_res1 0x0400 /* reserved for non-Opus 0000 0100 0000 0000 */
#define B_res2 0x0800 /* reserved for non-Opus 0000 1000 0000 0000 */
#define B_res3 0x1000 /* reserved for non-Opus 0001 0000 0000 0000 */
#define B_res4 0x2000 /* reserved for non-Opus 0010 0000 0000 0000 */
#define B_res5 0x4000 /* reserved for non-Opus 0100 0000 0000 0000 */
#define B_res6 0x8000 /* reserved for non-Opus 1000 0000 0000 0000 */
/*------------------------------------------------------------------------*/
/* Values for the `modem' field */
/*------------------------------------------------------------------------*/
#define M_HST 0x01 /* node uses an HST 0000 0001 */
#define M_PEP 0x02 /* node uses a PEP modem 0000 0001 */
/************************************************************************/
/* */
/* NODELIST.IDX record file structure. */
/* */
/************************************************************************/
struct _ndi
{
int node; /* node number */
int net; /* net number */
};
/************************************************************************/
/* */
/* QuickBBS 2.0 nodelist structure. This was taken from the file BINK.H */
/* from Binkley Term 1.5. */
/* */
/************************************************************************/
/*--------------------------------------------------------------------------*/
/* QuickBBS 2.00 QNL_IDX.BBS */
/* (File is terminated by EOF) */
/*--------------------------------------------------------------------------*/
struct QuickNodeIdxRecord
{
int QI_Zone;
int QI_Net;
int QI_Node;
byte QI_NodeType;
};
/*--------------------------------------------------------------------------*/
/* QuickBBS 2.00 QNL_DAT.BBS */
/* (File is terminated by EOF) */
/*--------------------------------------------------------------------------*/
struct QuickNodeListRecord
{
byte QL_NodeType;
int QL_Zone;
int QL_Net;
int QL_Node;
byte QL_Name[21]; /* Pascal! 1 byte count, up to 20 chars */
byte QL_City[41]; /* 1 + 40 */
byte QL_Phone[41]; /* 1 + 40 */
byte QL_Password[9]; /* 1 + 8 */
word QL_Flags; /* Same as flags in new nodelist structure */
int QL_BaudRate;
int QL_Cost;
};